stylecontext: Handle querying the wrong state better
authorBenjamin Otte <otte@redhat.com>
Tue, 21 Oct 2014 00:06:46 +0000 (02:06 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 21 Oct 2014 01:03:28 +0000 (03:03 +0200)
commita3995d8c86e80d39d6044f3f976c9f6deef1fa05
tree35ba500eea5ca2f906ca731538ae91969257997f
parentcaf709bb81b6e838b6f3a0d28608d2bab6d05669
stylecontext: Handle querying the wrong state better

When a getter function (like get_color()) is called and the passed in
state doesn't match the current state returned via get_state(), we used
to do a trick: We called save()/set_state() on the context before
getting the values.

Unfortunately, since 3a337156d11a86c7a88f1f30a09276fdf6f63008 this
has the unfortunate side effect that it also creates a child element.
This breaks various old codebases (spinbutton has been fixed in
998feeb2bc3e37275cfe915e128179d2704ca9c8, Webkit is fixed in
https://bugs.webkit.org/show_bug.cgi?id=137803 ) unfortunately.

So instead, look up the values manually ensuring that no child element
is created but the correct state is used.
gtk/gtkstylecontext.c